package br.com.dex.dexfitness.activitys;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import br.com.dex.dexfitness.R;
import br.com.dex.dexfitness.services.AzurePessoa;

import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.SherlockActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuInflater;

public class MainActivity extends SherlockActivity {

	private ActionBar actionBar;
	private ImageView btn_novo_aluno;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		actionBar = getSupportActionBar();
		actionBar.setDisplayShowHomeEnabled(true);
	
		new AzurePessoa(this);
		AzurePessoa.obterPessoas();
			
		btn_novo_aluno = (ImageView)findViewById(R.id.btn_novo_aluno);
		btn_novo_aluno.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent novoAluno = new Intent(MainActivity.this, NovoAlunoActivity.class);
				startActivity(novoAluno);
			}
			
		});
	}

	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		MenuInflater inflater = getSupportMenuInflater();
	    inflater.inflate(R.menu.main, menu);
	    return true;
	}
}
